package com.zhu.testcase.hellodemo.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration//配置类必须加，springboot的一种特色，之前的spring框架使用xml等进行配置
public class NameConfig {
    @Value("${myname:zhukai}")//myname占位符，zhukai默认配置
    private String myName;

    @Bean("namebean")
    public String getName(){
        return myName;
    }
}
